/*
 * @Description: 收藏、取消收藏
 */
import globalData from '@/plugins/data';
import globalMethods from '@/plugins/methods';

export function favorite(appName, sourceId, hasAtts, favoriteType) {
    const url = `${
        globalData.ctxPath
    }/doc/knowledgeController.do?method=toFavorite&sourceId=${sourceId}&appName=${appName}&hasAtts=${hasAtts}&favoriteType=${favoriteType}&t=${Math.random()}`;
    const dialog = globalMethods.dialog({
        url,
        width: 450,
        height: 440,
        title: this.$i18n('collaboration.common.flag.findAttributeSetting'),
        footer: null,
        onCancel() {
            dialog.close();
        },
    });
}
export function cancelFavorite(appName, sourceId, hasAtts, favoriteType) {
    const url = `${
        globalData.ctxPath
    }/doc/knowledgeController.do?method=toFavorite&sourceId=${sourceId}&appName=${appName}&hasAtts=${hasAtts}&favoriteType=${favoriteType}&t=${Math.random()}`;
    const dialog = globalMethods.dialog({
        url,
        width: 200,
        title: this.$i18n('collaboration.common.flag.findAttributeSetting'),
        footer: null,
        onCancel() {
            dialog.close();
        },
    });
}
